<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     enterprise_default
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */
?>
<?php if($this->getProductData()->getId()): ?>
<div class="product-review">
    <div class="page-title">
        <h1><?php echo $this->__('Review Details') ?></h1>
    </div>
    <div class="product-img-box">
        <a class="product-image" href="<?php echo $this->getProductData()->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProductData(), 'image')->resize(285, 285); ?>" alt="<?php echo $this->escapeHtml($this->getProductData()->getName()) ?>" height="285" width="285" /></a>
        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
        <p><?php echo $this->__('Average Customer Rating:') ?></p>
        <?php echo $this->getReviewsSummaryHtml($this->getProductData()) ?>
        <?php endif; ?>
    </div>
    <div class="details">
        <h2 class="product-name"><?php echo $this->escapeHtml($this->getProductData()->getName()) ?></h2>
        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
        <strong><?php echo ($this->isReviewOwner()) ? $this->__('Your Rating:') : $this->__('Rating:'); ?></strong>
        <table class="data-table review-summary-table">
        <?php foreach ($this->getRating() as $_rating): ?>
        <?php if($_rating->getPercent()): ?>
            <tr>
                <td class="label"><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></td>
                <td class="value">
                    <div class="rating-box">
                        <div class="rating" style="width:<?php echo ceil($_rating->getPercent()) ?>%;"></div>
                    </div></td>
            </tr>
        <?php endif; ?>
        <?php endforeach; ?>
        </table>
        <?php endif; ?>
        <p class="date">
            <?php if ($this->isReviewOwner()): ?>
                <?php echo $this->__('Your Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?>
            <?php else :?>
                <?php echo $this->__('Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?>
            <?php endif;?>
        </p>
        <p><?php echo nl2br($this->escapeHtml($this->getReviewData()->getDetail())) ?></p>
    </div>
    <div class="buttons-set">
        <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->__('Back to My Reviews') ?></a></p>
    </div>
</div>
<?php endif; ?>
